/*
 * @Author: wwssaabb
 * @Date: 2021-07-23 17:58:52
 * @LastEditTime: 2021-07-23 18:06:09
 * @FilePath: \demo\react_demo\react_stagin_demo\src\redux\count_actions.js
 */

/* 
    该文件专门为count组件生成action对象
*/

import { INCREMENT,DECREMENT } from '../constant'

export const increment=data=>({type:INCREMENT,data})
export const decrement=data=>({type:DECREMENT,data})
export const incrementAsync=(data,time)=>{
    return (dispatch)=>{
        setTimeout(()=>{
            dispatch(increment(data))
        },time)
    }
}
